#include <iostream>
#include <sys/types.h>
#include <signal.h>
#include <string>

// ./mykill signalnum pid 
int main(int argc, char* argv[])
{
    if(argc != 3)
    {
        std::cout << "./mykill signalnum pid" << std::endl;
        return 1;
    }

    int signalnum = std::stoi(argv[1]);
    pid_t target = std::stoi(argv[2]);  
    int n = kill(target, signalnum);
    if(n == 0)
    {
        std::cout << "send " << signalnum << " to " << target << " success" << std::endl;
    }
    return 0;
}